/*
 * @(#)MaintDmsRelationalWordForm.java
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */
package com.dcivision.dms.web;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.upload.FormFile;

import com.dcivision.dms.bean.DmsRelationalWord;
import com.dcivision.framework.ApplicationException;
import com.dcivision.framework.TextUtility;
import com.dcivision.framework.bean.AbstractBaseObject;
import com.dcivision.framework.web.AbstractActionForm;

/**
  <p>Class Name: MaintDmsRelationalWordForm.java         </p>

  <p>Description:This class is the for web form purpose.</p>

  @author          Weison Liang
  @company         DCIVision Limited
  @creation date   03/09/2004
  @version         $Revision: 1.10 $
*/

public class MaintDmsRelationalWordForm extends AbstractActionForm {

  public static final String REVISION = "$Revision: 1.10 $";

  private String keyword = null;
  private String parentID = null;
  private String keyNumber = null;
  private String type = null;
  private String curFunctionCode = null;
  private String relationKeyword=null;
  private String sonKeyNumber=null;
  private List sonKeywordList = null;
  private FormFile uploadFile = null; 
  private String rootID = null;
  private String documentName = null;

public String getKeyNumber() {
	return keyNumber;
}

public void setKeyNumber(String keyNumber) {
	this.keyNumber = keyNumber;
}

  
public String getDocumentName() {
	return documentName;
}

public void setDocumentName(String documentName) {
	this.documentName = documentName;
}

public String getSonKeyNumber() {
	return sonKeyNumber;
}

public void setSonKeyNumber(String sonKeyNumber) {
	this.sonKeyNumber = sonKeyNumber;
}

public String getRootID() {
	return rootID;
}

public void setRootID(String rootID) {
	this.rootID = rootID;
}
  public MaintDmsRelationalWordForm() {
    super();
  }
  
public List getSonKeywordList() {
	return sonKeywordList;
}

public void setSonKeywordList(List sonKeywordList) {
	this.sonKeywordList = sonKeywordList;
}

public String getKeyword() {
	return keyword;
}

public void setKeyword(String keyword) {
	this.keyword = keyword;
}

  public String getParentID() { 
    return(this.parentID);
  }

  public void setParentID(String parentID) { 
    this.parentID = parentID;
  }

  public String getType() { 
    return(this.type);
  }

  public void setType(String type) { 
    this.type = type;
  }
  public void setCurFunctionCode(String curFunctionCode) {
    this.curFunctionCode = curFunctionCode;
  }

  public String getCurFunctionCode() {
    return curFunctionCode;
  }

  public String getRelationKeyword(){
    return (this.relationKeyword);
  }
  public void setRelationKeyword(String relationKeyword){
    this.relationKeyword= relationKeyword;
  }
  public void setsonKeyNumber(String sonKeyNumber) {
    this.sonKeyNumber = sonKeyNumber;
  }

  public String getsonKeyNumber() {
    return (this.sonKeyNumber);
  }
  
  public void setUploadFile(FormFile uploadFile) {
    this.uploadFile = uploadFile;
  }

  public FormFile getUploadFile() {
    return(this.uploadFile);
  }

  public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
    return super.validate(mapping,request );
  }  

  public void reset(ActionMapping mapping, HttpServletRequest request) {
    super.reset(mapping, request);
    this.setID(null);
    this.setKeyword(null);
    this.setParentID(null);
    this.setType(null);
    this.setRecordStatus(null);
    this.setUpdateCount(null);
    this.setCreatorID(null);
    this.setCreateDate(null);
    this.setUpdaterID(null);
    this.setUpdateDate(null);
    this.setRelationKeyword(null);
    this.setSonKeywordList(null);
  }

  public AbstractBaseObject getFormData() throws ApplicationException {
    DmsRelationalWord tmpDmsRelationalWord = new DmsRelationalWord();
    tmpDmsRelationalWord.setID(TextUtility.parseIntegerObj(this.getID()));
    tmpDmsRelationalWord.setWord(this.getKeyword());
    tmpDmsRelationalWord.setParentID(TextUtility.parseIntegerObj(this.getParentID()));
    tmpDmsRelationalWord.setType(this.getType());
    tmpDmsRelationalWord.setRecordStatus(this.getRecordStatus());
    tmpDmsRelationalWord.setUpdateCount(TextUtility.parseIntegerObj(this.getUpdateCount()));
    tmpDmsRelationalWord.setCreatorID(TextUtility.parseIntegerObj(this.getCreatorID()));
    tmpDmsRelationalWord.setCreateDate(parseTimestamp(this.getCreateDate()));
    tmpDmsRelationalWord.setUpdaterID(TextUtility.parseIntegerObj(this.getUpdaterID()));
    tmpDmsRelationalWord.setUpdateDate(parseTimestamp(this.getUpdateDate()));
    return tmpDmsRelationalWord;
  }

  public void setFormData(AbstractBaseObject baseObj) throws ApplicationException {
    DmsRelationalWord tmpDmsRelationalWord = (DmsRelationalWord)baseObj;
    this.setID(TextUtility.formatIntegerObj(tmpDmsRelationalWord.getID()));
    this.setKeyword(tmpDmsRelationalWord.getWord());
    this.setParentID(TextUtility.formatIntegerObj(tmpDmsRelationalWord.getParentID()));
    this.setType(tmpDmsRelationalWord.getType());
    this.setRecordStatus(tmpDmsRelationalWord.getRecordStatus());
    this.setUpdateCount(TextUtility.formatIntegerObj(tmpDmsRelationalWord.getUpdateCount()));
    this.setCreatorID(TextUtility.formatIntegerObj(tmpDmsRelationalWord.getCreatorID()));
    this.setCreateDate(formatTimestamp(tmpDmsRelationalWord.getCreateDate()));
    this.setUpdaterID(TextUtility.formatIntegerObj(tmpDmsRelationalWord.getUpdaterID()));
    this.setUpdateDate(formatTimestamp(tmpDmsRelationalWord.getUpdateDate()));
  }  
}
